package com.qst.system.controller;

import com.qst.common.core.controller.BaseController;
import com.qst.common.core.domain.AjaxResult;
import com.qst.common.core.page.TableDataInfo;
import com.qst.system.domain.vo.BankSendVo;
import com.qst.system.service.IBankSendService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 放款统计图表Controller
 * 
 * @author 86182
 * @date 2025-08-23
 */
@RestController
@RequestMapping("/system/sendchart")
public class SendChartController extends BaseController {

    @Autowired
    private IBankSendService bankSendService;

    /**
     * 查询放款列表用于图表统计
     */
    @PreAuthorize("@ss.hasPermi('system:sendchart:list')")
    @GetMapping("/list")
    public TableDataInfo list(BankSendVo bankSendVo) {
        startPage();
        List<BankSendVo> list = bankSendService.selectBankSendList(bankSendVo);
        return getDataTable(list);
    }

    /**
     * 查询首页中的折线图的数据
     */
    @PreAuthorize("@ss.hasPermi('system:sendchart:chart')")
    @GetMapping("/chart")
    public AjaxResult chartData() {
        List<BankSendVo> list = bankSendService.selectBankSendList(new BankSendVo());
        return AjaxResult.success(list);
    }
}